Skip to content

feat(api): add scoped multi-instance query client#19

Merged
offendingcommit merged 1 commit into
mainfrom
feat/scoped-client-foundation
May 28, 2026
Merged

feat(api): add scoped multi-instance query client#19
offendingcommit merged 1 commit into
mainfrom
feat/scoped-client-foundation

Conversation

@offendingcommit
Copy link
Copy Markdown
Owner

Adds the multi-instance query layer:

  • createScopedClient(instance) — an openapi-fetch client bound to a specific instance rather than the active one in localStorage.
  • useScopedWorkspaces / useScopedPeers / useScopedPeerRepresentation / useScopedPeerCard — TanStack Query hooks with per-instance query-key isolation so caches never collide.

This is the foundation for the multi-instance features that follow (peer-card seed kits, desktop auto-discover) — landing it on its own keeps those PRs focused. It revives only the scoped-client scaffolding from the closed compare-view PR #14, not the full Compare UI.

Credit

Extracted from @BenSheridanEdwards's fork. Thanks Ben!

Verification

make check — lint + typecheck + 11/11 tests pass locally.

Adds createScopedClient() — an openapi-fetch client bound to a specific
Instance (rather than the active one in localStorage) — and the
useScoped* TanStack Query hooks (workspaces, peers, peer representation,
peer card) with per-instance query-key isolation so caches never collide
across instances.

Foundation for multi-instance features (seed kits, desktop
auto-discover) that read from non-active instances.

Co-authored-by: Ben Sheridan-Edwards <BenSheridanEdwards@users.noreply.github.com>
@offendingcommit offendingcommit merged commit 5d71d1e into main May 28, 2026
2 checks passed
@offendingcommit offendingcommit deleted the feat/scoped-client-foundation branch May 28, 2026 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants